<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>set the signature algorithm for a phar and apply it.  The</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="phardata.setmetadata.html">Phar::setMetadata</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="phardata.setstub.html">PharData::setStub</a></div>
 <div class="up"><a href="class.phardata.html">PharData</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="phardata.setsignaturealgorithm" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Phar::setSignatureAlgorithm</h1>
  <p class="verinfo">(PHP &gt;= 5.3.0, PECL phar &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">Phar::setSignatureAlgorithm</span> &mdash; <span class="dc-title">set the signature algorithm for a phar and apply it.  The</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-phardata.setsignaturealgorithm-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>Phar::setSignatureAlgorithm</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$sigtype</code></span>
   )</div>

  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">此方法需要
将 <var class="filename">php.ini</var> 中的 <em>phar.readonly</em> 设为
<em>0</em> 以适合 <a href="class.phar.html" class="classname">Phar</a>
对象.  否则, 将抛出<a href="class.pharexception.html" class="classname">PharException</a>.</p></p></blockquote>

  <p class="para">
   set the signature algorithm for a phar and apply it.  The
   signature algorithm must be one of <em>Phar::MD5</em>,
   <em>Phar::SHA1</em>, <em>Phar::SHA256</em>,
   <em>Phar::SHA512</em>, or <em>Phar::PGP</em>
   (pgp not yet supported and falls back to SHA-1).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-phardata.setsignaturealgorithm-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">sigtype</code></em></dt>

     <dd>

      <p class="para">
       One of <em>Phar::MD5</em>,
   <em>Phar::SHA1</em>, <em>Phar::SHA256</em>,
   <em>Phar::SHA512</em>, or <em>Phar::PGP</em>
      </p>
     </dd>

    
   </dl>

  </p>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-phardata.setsignaturealgorithm-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-phardata.setsignaturealgorithm-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   Throws <a href="class.unexpectedvalueexception.html" class="classname">UnexpectedValueException</a> for many errors,
   <a href="class.badmethodcallexception.html" class="classname">BadMethodCallException</a> if called for a zip- or
   a tar-based phar archive, and a <a href="class.pharexception.html" class="classname">PharException</a>
   if any problems occur flushing changes to disk.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-phardata.setsignaturealgorithm-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="phar.getsupportedsignatures.html" class="function" rel="rdfs-seeAlso">Phar::getSupportedSignatures()</a> - Return array of supported signature types</span></li>
    <li class="member"><span class="function"><a href="phar.getsignature.html" class="function" rel="rdfs-seeAlso">Phar::getSignature()</a> - Return MD5/SHA1/SHA256/SHA512/OpenSSL signature of a Phar archive</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="phardata.setmetadata.html">Phar::setMetadata</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="phardata.setstub.html">PharData::setStub</a></div>
 <div class="up"><a href="class.phardata.html">PharData</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
